import java.util.Scanner;
public class Test {

    public static void main(String[] args) {    //输出一个整数的每一位
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        while(n != 0) {
            System.out.println(n%10);
            n /= 10;
        }
    }
    public static void main9(String[] args) {
        int a =24,b=18,c = a%b;

    }

    public static void main8(String[] args) {
        int n = 7;
        for (int i = 31; i >= 1; i-=2) {
            System.out.print(((n >> i) & 1) + " ");
        }
        System.out.println();
        for (int i = 30; i >= 0 ; i-=2) {
            System.out.print(((n >> i) & 1) + " ");
        }
    }

    public static void main7(String[] args) {  //模拟登陆
        Scanner scanner = new Scanner(System.in);
        int cnt = 3;
        while (cnt != 0) {
            System.out.println("输入密码，还剩"+cnt+"次机会");
            String pass = scanner.nextLine();
            if(pass.equals("123")) {   //用equals来比较字符串
                System.out.println("登陆成功");
            } else {
                System.out.println("登陆失败");
            }
            cnt--;
        }
    }



    public static void main6(String[] args) {   //打印乘法表
        for (int i = 1; i <= 9; i++) {
            for(int j = 1;j <= i;j++) {
                System.out.print(i + "*" + j + "=" + i*j + " ");
            }
            System.out.println();
        }
    }

    public static void main5(String[] args) {   //打印所有的水仙花数
        for (int i = 1; i < 999999; i++) {
            int cnt = 0;
            int tmp = i;
            int sum = 0;
            while (tmp != 0) {
                tmp /= 10;
                cnt++;    //cnt存储了当前i是几位数
            }
            tmp = i;
            while (tmp != 0) {
                sum += Math.pow(tmp%10,cnt);
                tmp /= 10;
            }
            //sum存储了和
            if(sum == i) {
                System.out.println(i);
            }
        }
    }



    public static void main4(String[] args) {    //计算分数
        double sum = 1.0;
        int flag = 1;
        for (int i = 1; i <= 100; i++) {
            sum = sum + 1.0 / i * flag;
            flag = -flag;
        }
        System.out.println(sum);
    }


    public static void main3(String[] args) {   //ver3 最优解
        int n = -1;
        int cnt = 0;
        while(n != 0) {
            n = n & (n - 1);
            cnt++;
        }
        System.out.println(cnt);
    }


    public static void main2(String[] args) {   //ver2
        int n = -1;
        int cnt = 0;
        while(n != 0) {
            if((n &1) != 0) {
                cnt++;
            }
            n = n >>> 1;
        }
        System.out.println(cnt);
    }

    public static void main1(String[] args) {   //二进制1的个数 ver1
        int n = 7;
        int cnt = 0;
        for (int i = 0; i < 32; i++) {
            if(((n >> i) & 1) != 0) {
                cnt++;
            }
        }
        System.out.println(cnt);
    }
}
